<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path;
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport"content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="format-detection" content="telephone=no" />
<link href="<%=basePath%>/css/hm.css" rel="stylesheet" />
<link href="<%=basePath%>/css/sweetalert.css" rel="stylesheet" />

<script type="text/javascript" src="<%=basePath%>/js/jquery-2.1.0.min.js"></script>
<script type="text/javascript" src="<%=basePath%>/weui/jquery-weui.js"></script>
<script type="text/javascript" src="<%=basePath%>/js/sweetalert.min.js"></script>
	<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<title>答对了${player.rightCount }题，汉宁红木-红木知识等级考试</title>
<style>

</style>
</head>
<body class="hm-q-body">
	<div class="hm-q-content" style="text-align:center">
		<div class="hm-q-question" style="margin-top:20%;">
		
			<div class="hm-q-question-logo"></div>
			<br>
			<h2 style="font-weight:500;font-size:20px;">答对了${player.rightCount }题，获得称号</h2>
			<h1 style="font-weight:500">
				<c:if test="${player.rightCount<=4 }">兔小白</c:if>
				<c:if test="${player.rightCount>=5 && player.rightCount<7 }">兔兔哥</c:if>
				<c:if test="${player.rightCount>=7 }">兔博士</c:if>
			</h1>
			<br>
			<c:if test="${player.rightCount<=4 }">
			<img class="hm-result-img" src="<%=basePath%>/images/wenjuan/txb.png"/>
			</c:if>
			<c:if test="${player.rightCount>=5 && player.rightCount<7 }">
			<img class="hm-result-img" src="<%=basePath%>/images/wenjuan/ttg.png"/>
			</c:if>
			<c:if test="${player.rightCount>=7 }">
			<img class="hm-result-img" src="<%=basePath%>/images/wenjuan/tbs.png"/>
			</c:if>
			<br>
			<!-- <a href="javascript:;" onclick="share()" class="weui_btn weui_btn_primary">去分享</a> -->
			<div class="hm-main-btn" style="color:#fff;background-color:rgb(4, 190, 2);border-width:0;" onclick="share()">
				去分享
			</div>
			<!-- <div class="hm-main-btn2" onclick="window.location.href='main.htm'">
				参与答题
			</div> -->
		</div>
		
		<div class="hm-q-question" style="text-align:center">
			<h2>以下为答案</h2>
			<br>  
			<p style="color:#3366FF">蓝色为正确答案</p>
			<p style="color:#CC0000">红色为您的答案</p>
			<c:forEach var="question" items="${result}" varStatus="status">
		<div class="" >
			<!-- <div class="hm-q-question-logo"></div> -->
			<br>
			<p class="hm-q-question-title" style="text-align:left">
				<c:if test="${question.correctStatus==1}">
				<span style="color:#3366FF">正确&nbsp;&nbsp;</span>
				</c:if>
				<c:if test="${question.correctStatus==2}">
				<span style="color:#CC0000">错误&nbsp;&nbsp;</span>
				</c:if>
				${status.index+1} . 
				${question.title}
			</p>
			<p style="color:#3366FF">正确答案：
				<c:if test="${question.right == 'A'}">${question.answerA}</c:if>
				<c:if test="${question.right == 'B'}">${question.answerB}</c:if>
				<c:if test="${question.right == 'C'}">${question.answerC}</c:if>
				<c:if test="${question.right == 'D'}">${question.answerD}</c:if>
			</p>
			<p style="color:#CC0000">您的答案：
				<c:if test="${question.yours == 'A'}">${question.answerA}</c:if>
				<c:if test="${question.yours == 'B'}">${question.answerB}</c:if>
				<c:if test="${question.yours == 'C'}">${question.answerC}</c:if>
				<c:if test="${question.yours == 'D'}">${question.answerD}</c:if>
			</p>
			<%-- <div class="hm-q-question-ans-content">
				<div 
					class="
						hm-q-question-ans 
						<c:if test="${question.right == 'A'}">right</c:if>
						<c:if test="${question.yours == 'A' && question.right != 'A'}">wrong</c:if>
						" 
					index="${status.index}" 
					qid="${question.id}" 
					ans="A"
				>${question.answerA}</div>
				
				<div 
					class="
						hm-q-question-ans 
						<c:if test="${question.right == 'B'}">right</c:if>
						<c:if test="${question.yours == 'B' && question.right != 'B'}">wrong</c:if>
						" 
					index="${status.index}" 
					qid="${question.id}" 
					ans="B"
				>${question.answerB}</div>
				
				<c:if test="${question.type == 2}">
				<div 
					class="
						hm-q-question-ans 
						<c:if test="${question.right == 'C'}">right</c:if>
						<c:if test="${question.yours == 'C' && question.right != 'C'}">wrong</c:if>
						" 
					index="${status.index}" 
					qid="${question.id}" 
					ans="C"
				>${question.answerC}</div>
				
				<div 
					class="
						hm-q-question-ans 
						<c:if test="${question.right == 'D'}">right</c:if>
						<c:if test="${question.yours == 'D' && question.right != 'D'}">wrong</c:if>
						" 
					index="${status.index}" 
					qid="${question.id}" 
					ans="D"
				>${question.answerD}</div>
				</c:if>
			</div>

			<c:if test="${status.index%2==1}">
			<div class="hm-q-question-tail1"></div>
			</c:if>
			<c:if test="${status.index%2==0}">
			<div class="hm-q-question-tail2"></div>
			</c:if> --%>
		</div>
        </c:forEach>
			
		</div>
		
		<%-- <c:forEach var="question" items="${result}" varStatus="status">
		<div class="hm-q-question">
			<div class="hm-q-question-logo"></div>
			<br>
			<div class="hm-q-question-title" style="text-align:left">
				<c:if test="${question.correctStatus==1}">
				<span style="color:#3366FF">正确&nbsp;&nbsp;</span>
				</c:if>
				<c:if test="${question.correctStatus==2}">
				<span style="color:#CC0000">错误&nbsp;&nbsp;</span>
				</c:if>
				${status.index+1} . 
				${question.title}
			</div>
			<div class="hm-q-question-ans-content">
				<div 
					class="
						hm-q-question-ans 
						<c:if test="${question.right == 'A'}">right</c:if>
						<c:if test="${question.yours == 'A' && question.right != 'A'}">wrong</c:if>
						" 
					index="${status.index}" 
					qid="${question.id}" 
					ans="A"
				>${question.answerA}</div>
				
				<div 
					class="
						hm-q-question-ans 
						<c:if test="${question.right == 'B'}">right</c:if>
						<c:if test="${question.yours == 'B' && question.right != 'B'}">wrong</c:if>
						" 
					index="${status.index}" 
					qid="${question.id}" 
					ans="B"
				>${question.answerB}</div>
				
				<c:if test="${question.type == 2}">
				<div 
					class="
						hm-q-question-ans 
						<c:if test="${question.right == 'C'}">right</c:if>
						<c:if test="${question.yours == 'C' && question.right != 'C'}">wrong</c:if>
						" 
					index="${status.index}" 
					qid="${question.id}" 
					ans="C"
				>${question.answerC}</div>
				
				<div 
					class="
						hm-q-question-ans 
						<c:if test="${question.right == 'D'}">right</c:if>
						<c:if test="${question.yours == 'D' && question.right != 'D'}">wrong</c:if>
						" 
					index="${status.index}" 
					qid="${question.id}" 
					ans="D"
				>${question.answerD}</div>
				</c:if>
			</div>

			<c:if test="${status.index%2==1}">
			<div class="hm-q-question-tail1"></div>
			</c:if>
			<c:if test="${status.index%2==0}">
			<div class="hm-q-question-tail2"></div>
			</c:if>
		</div>
        </c:forEach> --%>
	</div>
	<div id="share" style="display:none" onclick="sharehide()">
	<img style="position:absolute;top:0;right:0;" alt="" src="<%=basePath %>/images/wenjuan/guide.png">
	</div>
	<script>
	function share(){
		$('#share').show();
	};
	function sharehide(){
		$('#share').hide();
	};
	
	/* 微信jssdk */
	wx.config({
	    debug: false,                            // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
	    appId: '${mapJSSDK["appId"]}', 			 // 必填，公众号的唯一标识
	    timestamp:   parseInt('${mapJSSDK["timestamp"]}', 10) , 	 // 必填，生成签名的时间戳
	    nonceStr: '${mapJSSDK["nonceStr"]}', 	 // 必填，生成签名的随机串
	    signature: '${mapJSSDK["signature"]}',   // 必填，签名，见附录1
	    jsApiList: ['onMenuShareTimeline']       // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
	});
	var onMenuShareTimeline_Title = "答对了${player.rightCount }题，汉宁红木-红木知识等级考试"; 
	var onMenuShareTimeline_Link = "<%=basePath%>/main.htm"; 
	var onMenuShareTimeline_ImgUrl = '<%=basePath%>/images/wenjuan/logo.png';//获取图片
	//var onMenuShareTimeline_ImgUrl = $('.hm-q-question img').attr('src');//获取图片
			
	wx.ready(function(){
		/* 微信分享 */
		wx.onMenuShareTimeline({
		    title: onMenuShareTimeline_Title, 	// 分享标题
		    link: onMenuShareTimeline_Link, 	// 分享链接
		    imgUrl: onMenuShareTimeline_ImgUrl, // 分享图标
		    success: function () {
		    	$.toast("分享成功");
		    },
		    cancel: function () {
		    }
		});
	});
	
	
	</script>
</body>
</html>